/**
 * Created by oneminute on 14-6-19.
 */

var moment = require('moment');
var lz = require("../utils/modules")();

function Issue(_opts) {
    lz.Persistent.call(this, _opts);
    if (!_opts) _opts = {};
    this.__properties.pushArray([
        { name: "id", value: _opts.id || -1 },
        { name: "uid", value: _opts.uid || "" },
        { name: "type", value: _opts.type || "POST" },
        { name: "title", value: _opts.title || "" },
        { name: "publishTime", value: _opts.publishTime || moment().format(lz.Config.datetimeFormat) },
        { name: "content", value: _opts.content || "" }
    ]);
    this.__initProperties();
    this.__collection = lz.Config.db.arango.gifts;
    this.__aql = lz.Config.db.arango.aqls.GET_OBJECT_BY_PROPERTY;
}

require("util").inherits(Issue, lz.Persistent);

exports = module.exports = Issue;
